package com.example.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class ChatDbHelper extends SQLiteOpenHelper {

    public static final String dbname="db_chat";
    public ChatDbHelper(Context context) { super(context, "dbchat", null, 1);
    }
    //创建用户表
    @Override
    public void onCreate(SQLiteDatabase db) {
        //账号/手机号userId，密码passWord，姓名name，邮箱email，地址address
        db.execSQL("create table if not exists chats" +
                "(chatid integer primary key autoincrement," +
                "chatreceiveno integer," +
                "chatsendno integer," +
                "chatcontent text," +
                "chattype boolen)");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

